//
//  UIButton+General.h
//  shopping
//
//  Created by 阿帕 on 2018/5/18.
//  Copyright © 2018年 GCY. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, MKButtonEdgeInsetsStyle) {
    MKButtonEdgeInsetsStyleTop, // image在上，label在下
    MKButtonEdgeInsetsStyleLeft, // image在左，label在右
    MKButtonEdgeInsetsStyleBottom, // image在下，label在上
    MKButtonEdgeInsetsStyleRight // image在右，label在左
};

@interface UIButton (General)

/**
 *  设置button的titleLabel和imageView的布局样式，及间距
 *
 *  @param style titleLabel和imageView的布局样式
 *  @param space titleLabel和imageView的间距
 */
- (void)layoutButtonWithEdgeInsetsStyle:(MKButtonEdgeInsetsStyle)style
                        imageTitleSpace:(CGFloat)space;


@end

//初始化button(链式)
@interface UIButton (Initialize)
/**
 设置Button.TextLabel的文字 字体大小 文字颜色
 */
@property(copy, nonatomic) UIButton *(^titleParams)(NSString *title, CGFloat fontSize, UIColor *textColor);

@property(copy, nonatomic) UIButton *(^selfBackGroundColor)(UIColor *backGroundColor);

@property(copy, nonatomic) UIButton *(^selfImage)(UIImage *image);

@end


@interface UIButton (repeat)

/** 按钮重复点击的时间间隔,以秒为单位 **/

@property NSTimeInterval repeatEventInterval;


@end

